#ifndef _DTEXTWRITABLE_H
#define _DTEXTWRITABLE_H

//==============================================================================
//
//       DTextWritable - the text writable protocol in the ofc-library
//
//               Copyright (C) 2003  Dick van Oudheusden
//  
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public
// License along with this program; if not, write to the Free
// Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
//
//==============================================================================
// 
//  $Date: 2003-09-10 06:01:22 $ $Revision: 1.4 $
//
//==============================================================================

#include "ofc/config.h"

// The TextWritable protocol specifies the interface for writing of text to
// a class implementing this interface.

@protocol DTextWritable

//
// Write a text string 
//
// @param text     the text to be written
//
// @return success
//

- (BOOL) writeText :(const char *) text;

//
// Write a line (appending a '\n')
//
// @param text     the text to be written as line
//
// @return success
//

- (BOOL) writeLine :(const char *) text;

//
// Write a character
//
// @param ch       the character to be written
//
// @return success
//

- (BOOL) writeChar :(char) ch;

//
// Tell the current position in the writeable
//
// @return the current position
//

- (unsigned long) tell;

//
// Move the current position to a location
//
// @param offset   the offset from the origin (in bytes)
// @param origin   the origin for the offset (0=begin, 1=current, 2=end)
//
// @return success
//

- (BOOL) seek :(unsigned long) offset :(int) origin;

//
// Skip a number of positions
//
// @param offset   the number of bytes to skip
//
// @return success
//

- (BOOL) skip :(unsigned long) offset;

//
// Return the last error
//
// @return the last error (or 0)
//

- (int) error;

@end

#endif

/*============================================================================*/

